# decorator add

def decorator(mufunc, flag):

    def fun_in(a, b):

        if flag == '+':
            print('正在加法计算')
        elif flag =='-':
            print('正在减法计算')

        c = mufunc(a, b)
        return c

    # 有返回
    return fun_in



@decorator('+')     #  add =  decorator(add)   #  TypeError: decorator() missing 1 required positional argument: 'flag'
def add(a, b):
    c = a + b
    return c


result = add(10, 20)
print(result)